//============================================================================
// Name        : Simulation1.cpp
// Author      : Aaron
// Version     :
// Copyright   :
// Description : Hello World in C, Ansi-style
//============================================================================

#include <iostream>
#include <string>
#include <list>
#include <map>
#include <vector>
#include <set>
#include <iterator>
#include <exception>
#include <sstream>
#include <boost/bind.hpp>
#include <boost/any.hpp>
#include <boost/signals.hpp>

#include <SDL/SDL.h>
#include <SDL/SDL_mixer.h>
#include <SDL/SDL_ttf.h>
#include <GL/GLee.h>
#include "math.hpp"
#include "SignalBroker.hpp"
#include "SceneNode.h"
#include "SceneGraph.h"
#include "OutputStreamView.hpp"
#include "ClockView.hpp"
#include "OpenGL/util.hpp"
#include "SceneNodeProperties.hpp"
#include "SceneGraphController.hpp"
#include "AnimationController.hpp"
#include "Simulation1SceneGraphLoader.hpp"
#include "SDLEventsView.hpp"
#include "Simulation1InputView.hpp"
#include "PlayerMovementController.hpp"
#include "SDLRenderView.hpp"
#include "OpenGLRenderView.hpp"
#include "TextureFactory.hpp"
#include "PongPhysics.hpp"
#include "PongLogic.hpp"
#include "PongAI.hpp"
#include "SDLPongAudio.hpp"

int main(int argc, char *argv[]) try{
	SignalBroker signalbroker;
	//application agnostic
	ClockView clockview = ClockView(signalbroker);
	SDLEventsView sdleventsview = SDLEventsView(signalbroker);
	OutputStreamView errorview = OutputStreamView(signalbroker, std::cout);
	SDLRenderView renderview = SDLRenderView(signalbroker);
	SceneGraphController scenegraphcontroller = SceneGraphController(signalbroker);
	OpenGLRenderView openglrenderview = OpenGLRenderView(signalbroker);

	//application specific
	Simulation1SceneGraphLoader simulation1scenegraphloader = Simulation1SceneGraphLoader(scenegraphcontroller, signalbroker);
	Simulation1InputView simulation1inputview = Simulation1InputView(signalbroker);
	PlayerMovementController playermovementcontroller = PlayerMovementController(signalbroker);
	PongLogic ponglogic = PongLogic(signalbroker);
	PongPhysics pongphysics = PongPhysics(signalbroker);
	PongAIController pongai = PongAIController(signalbroker);
	SDLPongAudio pongaudio = SDLPongAudio(signalbroker);
	clockview.Start();

    return 0;
}catch(std::exception& e){
	std::cout << "Error occured. Caught in main(). " << e.what() << std::endl;
	return 0;
}

